#encoding:UTF-8
'''
Created on Mar 2, 2014

@author: Wu Botao
'''

class Rabbit(object):

    def __init__(self, name):
        self._name = name

    @staticmethod
    def newRabbit(name):
        return Rabbit(name)

    @classmethod
    def newRabbit2(cls):
        return Rabbit('')

    @property
    def name(self):
        return self._name
    
    @name.setter
    def name(self, name):
        self._name = name
        
        
r = Rabbit('hello')
print r.name
r.name = 'libo' 
print r.name

#類似Js中的__defineGetter__和__defineSetter__


